<?php
	include "generador_tablas.php";
?>
<div class="col-lg-8">
    <div class="panel panel-default">
        <div class="panel-body" style = "background: #CEE3F6">
			<div class="col-xs-12"><h2>Gestión de Asignaturas</h2><br/></div>
			<div class = "col-xs-12"></br></div>
			<form method="post" action ="eliminar_registro.php" class = "col-xs-12">
				<div class="panel panel-default col-xs-12">
					<?php 
				 		mostrar_tabla('asignatura',array('codigo','nombre','uc','ofertada'),'codigo');
				 	?>
				</div></br>
				<div class = "col-md-2"></div>
				<div class = "col-md-4"><input class = "btn btn-primary col-xs-12" value = "Modificar"></div>
				<div class = "col-md-4"><input class = "btn btn-primary col-xs-12" id="eliminar" type="submit" value = "Eliminar"></div></br></br></br>
				<div class = "col-md-2"></div>
				<div class="row-fluid"></div><div class="row-fluid"></div>
				<input type="hidden" name="tabla" value="asignatura">
				<input type="hidden" name="campo" value="codigo">
				<input type="hidden" name="pagina" value="gestionar_asignaturas">
			</form>
   	 	</div>
	</div>
</div>
<div class="col-lg-4">
    <div class="panel panel-default">
        <div id = "seleccionado" class="panel-body" style = "background: #CEE3F6">
    </div>
</div>

<script>
	$("#myTable").dataTable({
            "oLanguage": {
                "sUrl": "lang/dataTables.spanish.txt"
            }
        } );
</script>
<script>
function carga(p1, p2, p3)
{
	var xxx = {
		dato: p1,
		tabla: p2,
		campo: p3
	};
    $.ajax({type:"POST",url:"mostrar_datos.php",data: xxx, success:function(result){$("#seleccionado").html(result);}});
}
$("#eliminar").click(function(){return confirm("¿Está seguro que desea eliminar este(os) registro(s)?")});
</script>